//
// Created by DengLibin on 2019/1/18 0018.
//
#include <iostream>
using  namespace std;
struct TreeNode {
     int val;
     TreeNode *left;
     TreeNode *right;
     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 };
/**
 * 判断两个二叉树是否相等
 * @param p
 * @param q
 * @return
 */
bool isSameTree(TreeNode* p, TreeNode* q) {
    //空判断
    if(p == NULL || q == NULL){
        return p == NULL && q == NULL;
    }
    //比较值
    if(p->val != q->val){
        return false;
    }
    //比较子节点
    return isSameTree(p->left, q->left) && isSameTree(p->right, q->right);

}





